import { http } from '@/utils/request.js'
/**
 * @typedef {object} ListParams
 * @property {number} [pageNum=1]
 * @property {number} [pageSize=10]
 * @property {string|number} [status]
 */

const annualFeeService = {
  /**
   * 获取年费列表
   * @param {ListParams} data
   * @returns {Promise}
   */
  list(data) {
    return http.get('/system/annualFee/list', data)
  },
  getDetail(id,data) {
    return http.get(`/system/annualFee/${id}`,data)
  },
  payByCustomerSelf(id, data) {
    return http.put(`/system/annualFee/payByCustomerSelf/${id}?paymentTime=${data?.paymentTime}`, null)
  },
  update(data) {
    return http.post('/system/annualFee/update', data)
  },
  insert(id) {
    return http.post(`/system/annualFeeJfd/insert/${id}`, null)
  },
  listToDiscount(data){
    return http.get('/system/annualFee/listToDiscount', data)
  },
  discountBatch(data){
    return http.put('/system/annualFee/discountBatch', data)
  }
}

export default annualFeeService
